package com.ciaojian.core.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.ciaojian.core.enums.business.LeaveDetailType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 请假详情表
 * </p>
 *
 * @author Atlakyn
 * @since 2021-06-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("d_leave_detail")
public class LeaveDetail extends Model<LeaveDetail> {
    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("申请ID")
    private Integer applyId;

    @ApiModelProperty("开始时间")
    private Date beginDate;

    @ApiModelProperty("开始时间段 0早 1晚")
//    @NotNull(message = "请选择早班或晚班")
    private Integer beginRange;

    @ApiModelProperty("结束时间")
    private Date endDate;

    @ApiModelProperty("结束时间段 0早 1晚")
//    @NotNull(message = "请选择早班或晚班")
    private Integer endRange;

    @ApiModelProperty("请假天数")
    private Double days;

    @ApiModelProperty("请假事由")
    private String reason;

    @ApiModelProperty("请假类型")
    private LeaveDetailType type;

    @ApiModelProperty("照片列表")
    private String img;

    @ApiModelProperty("是否请半天 0上半天 1下半天")
    private Integer half;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
